package cn.echisan.homework.service.impl;

import cn.echisan.homework.dao.ScoreMapper;
import cn.echisan.homework.model.Score;
import cn.echisan.homework.service.ScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by echisan on 2018/5/29
 */
@Service
public class ScoreServiceImpl implements ScoreService {

    @Autowired
    private ScoreMapper scoreMapper;

    @Override
    public List<Score> listUserScoreByUserId(Integer userId) {

        List<Score> scores = scoreMapper.listUserScoreByUserId(userId);
        if (scores == null || scores.size() == 0){
            return null;
        }
        return scores;
    }
}
